~:extend('user')~

	~[left]~



	    <div class="span3">
          <div class="well sidebar-nav">
            <ul class="nav nav-list">
              <li class="nav-header">Youwebapp</li>
              <li><a href="~~:url('user')~"><i class="icon-th-list"></i> 主页</a></li>
              <li ><a href="~~:url('add')~"><i class="icon-plus"></i> 添加</a></li>
              <li class="active"><a href="~~:url('edit')~"><i class="icon-pencil"></i>编辑</a></li>

              <li class="nav-header">User</li>
              <li><a href="~~:url('config')~"><i class="icon-user"></i> 用户</a></li>
              <li><a href="~~:url('logout')~"><i class="icon-off"></i> 登出</a></li>

            </ul>
          </div><!--/.well -->
        </div><!--/span-->
	~[/left]~

	~[right]~
    <style type="text/css">
    #iphone-portrait{
      width: 370px;
      height: 700px;
      background-color: ;
      margin-top: -820px;
      margin-left: 90px;
      position: absolute;    }

    </style>

        <div class="span9">
          
          	<table class="table table-striped">
            


              <tr><td>#</td><td>题目</td><td>时间</td><td>编辑</td></tr>
              <?php $i=0; ?>
              ~foreach ($data.RESULT as $result):~
              
              <tr><td>~~$i=$i+1~</td>
              <td><a href="~~:url('webapp')~~~:escape($result.code)~" > ~~:escape($result.title)~ </a></td>
              <td> ~~:escape($result.add_time)~ </td>
              <td>
                <a href="~~:url('editpage')~~~:escape($result.wid)~" ><i class="icon-pencil"></i></a>

                

                

                &nbsp;&nbsp;<a id="linkbutton~~$i~" data-toggle="modal" href="#"><i class="icon-random"></i></a>

                &nbsp;&nbsp;<a data-toggle="modal" href="#myModalQR~~$i~"><i class="icon-qrcode"></i></a>
                
                &nbsp;&nbsp;<a id="deletebutton~~$i~" data-toggle="modal" href="#"><i class="icon-trash"></i></a>

                &nbsp;&nbsp;<a id="morebutton~~$i~" data-toggle="modal" href="#"><i class="icon-plus"></i></a>

                &nbsp;&nbsp;<!--a data-toggle="modal" href="#myModaliphone~~$i~"><img src="~~:url('img/iphone.png')~" width="14px" style="margin-top:-3px;"></a-->
                <script type="text/javascript">

                  $("#deletebutton~~$i~").click(function () {
                    $("#myModal~~$i~").fadeToggle("slow");
                  });

                  $("#linkbutton~~$i~").click(function () {
                    $("#myModallink~~$i~").fadeToggle("slow");

                  });

                  $("#morebutton~~$i~").click(function () {
                    $("#moreModal~~$i~").fadeToggle("slow");

                  });

                </script>



                <div id="myModalQR~~$i~" class="modal hide fade" style="display: none;">
                  <div class="modal-header">
                    <button class="close" data-dismiss="modal">×</button>
                    <h3>QR码</h3>
                  </div>
                  <div style="width:150px; margin:0px auto;">
                    <img src="http://chart.apis.google.com/chart?cht=qr&chs=150x150&chl=http://youwebapp.com/webapp/~~:escape($result.code)~">
                  </div>
                  <div class="modal-footer" style="">
                    <a href="#" class="btn" data-dismiss="modal">返回</a>
                    <a href="http://chart.apis.google.com/chart?cht=qr&chs=150x150&chl=http://youwebapp.com/webapp/~~:escape($result.code)~" class="btn btn-success" TARGET="_blank">在新的窗口打开</a>
                  </div>
                </div>

                <!--div id="myModaliphone~~$i~" class="modal hide fade" style="display: none;">
                  <img src="~~:url('img/iphone5.png')~">
                  <iframe src="~~:url('webapp')~~~:escape($result.code)~" id="iphone-portrait"></iframe>
                </div-->


              </td></tr>

              <!-- myModal Delete -->

              <tr id="myModal~~$i~" class="warning" style="display:none">
                <td colspan="3" style="text-align:center;"><p style="margin-top:5px;">你确定要删除这个Webapp?</p></td><td><a href="~~:url('delete')~~~:escape($result.wid)~" class="btn btn-danger">确定</a>  <a href="" data-toggle="modal" id="hidebutton~~$i~" class="btn btn-success">取消</a></td>
              </tr>

              <!-- myModal change links -->

              <tr id="myModallink~~$i~" class="info" style="display:none">
                <form name="myform" class="form-signin" action="~~:url(:escape($page.path))~~~:escape($result.wid)~" method="post">
                  <td colspan="3" style="text-align:center;">
                    <div class="input-prepend input-append">
                      <span class="add-on">现在的链接：http://youwebapp.com/webapp/</span>
                      ~~Morrow\Formhtml::getElement('myform', 'link', array("class"=> "span2","id"=>"prependedInput","value"=>:escape($result.code)));~ 
                    </div>
                  </td>
                  <td><button class="btn btn-success" type="submit">提交</button>  <a href="" class="btn" data-toggle="modal" id="linkhidebutton~~$i~">取消</a></td>
                </form>
              </tr>

              <!-- myModal more -->

              <tr id="moreModal~~$i~" class="success" style="display:none">
                <form name="myform_contact" action="~~:url(:escape($page.path))~~~:escape($result.wid)~" method="post">
                  <td colspan="3" style="text-align:left;">
                      隐藏Webapp内容 ~~Morrow\Formhtml::getElement('myform_contact', 'hidecontent', array("class"=> "span2","dtype"=>"checkbox","value"=>:escape($result.hidecontent), "style"=>"margin-top:-3px"));~ <br/><br/>

                      显示联系方式(可以在"用户"里修改联系方式) ~~Morrow\Formhtml::getElement('myform_contact', 'showcontact', array("class"=> "span2","dtype"=>"checkbox","value"=>:escape($result.showcontact), "style"=>"margin-top:-3px"));~ <br/><br/>
                      
                      <div class="input-prepend input-append">
                        <span class="add-on">为Webapp设置密码(0为无密码): </span>
                        ~~Morrow\Formhtml::getElement('myform_contact', 'jiami', array("class"=> "span2","id"=>"prependedInput","value"=>:escape($result.jiami)));~ 
                      </div>
                     ~~Morrow\Formhtml::getElement('myform_contact', 'secret', array('errorclass' => 'error', 'displaytype' => 'hidden'));~

                  </td>
                  <td><button class="btn btn-success" type="submit">提交</button>  <a href="" class="btn" data-toggle="modal" id="morehidebutton~~$i~">取消</a></td>
                </form>
              </tr>

               <!-- myModal more -->
              <script type="text/javascript">

                  $("#hidebutton~~$i~").click(function () {
                    $("#myModal~~$i~").hide("slow");
                  });

                  $("#linkhidebutton~~$i~").click(function () {
                    $("#myModallink~~$i~").hide("slow");
                  });

                  $("#morehidebutton~~$i~").click(function () {
                    $("#moreModal~~$i~").hide("slow");
                  });

                </script>
              ~endforeach~

            </table>
        </div><!--/span-->

	~[/right]~